package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.ZhuanyiItemSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.ZhuanyiItemSL;

@Component
public class ZhuanyiItemSLConverter extends AbstractConverter<ZhuanyiItemSL, ZhuanyiItemSLDTO> {

    @Override
    public ZhuanyiItemSL toModel(final ZhuanyiItemSLDTO dto) {

        final ZhuanyiItemSL model = new ZhuanyiItemSL();

        model.setName(dto.getName());
        model.setCode(dto.getCode());
        model.setSpecifications(dto.getSpecifications());
        model.setSerialnumber(dto.getSerialnumber());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setManagementUserCode(dto.getManagementUserCode());
        model.setManagementUserName(dto.getManagementUserName());
        model.setLocation(dto.getLocation());
        model.setLocationName(dto.getLocationName());
        model.setZhuanyiLocation(dto.getZhuanyiLocation());
        model.setZhuanyiLocationName(dto.getZhuanyiLocationName());
        model.setZhuanyiUserCode(dto.getZhuanyiUserCode());
        model.setZhuanyiUserName(dto.getZhuanyiUserName());
        model.setStatus(dto.getStatus());
        return model;
    }

    @Override
    public ZhuanyiItemSLDTO toDTO(final ZhuanyiItemSL model, final boolean forListView) {
        final ZhuanyiItemSLDTO dto = new ZhuanyiItemSLDTO();
        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setCode(model.getCode());
        dto.setSpecifications(model.getSpecifications());
        dto.setSerialnumber(model.getSerialnumber());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setManagementUserCode(model.getManagementUserCode());
        dto.setManagementUserName(model.getManagementUserName());
        dto.setLocation(model.getLocation());
        dto.setLocationName(model.getLocationName());
        dto.setZhuanyiLocation(model.getZhuanyiLocation());
        dto.setZhuanyiLocationName(model.getZhuanyiLocationName());
        dto.setZhuanyiUserCode(model.getZhuanyiUserCode());
        dto.setZhuanyiUserName(model.getZhuanyiUserName());
        dto.setStatus(model.getStatus());
        return dto;
    }

}
